import {ref} from 'vue'
import { setRequestBaseURL } from '@/common/request'
import {setIMUrl} from '@/common/utils/IM/init'
import {EXTCONFIG} from '@/env'

export const mpAppStaticPath = ref('')

let extConfig = wx.getExtConfigSync() ? wx.getExtConfigSync() : null
if (extConfig !== null) {
	if (process.env.NODE_ENV === 'development') {
		extConfig = EXTCONFIG
	}

	console.log(extConfig, 'extConfig')
	uni.setStorageSync('tenant', extConfig.tenant)
	setRequestBaseURL(extConfig.domain)
	extConfig.socketDomain&&setIMUrl(extConfig.socketDomain)
	mpAppStaticPath.value = extConfig['mp-static']
}

